package com.mjh.controller;

import com.mjh.bean.UserRole;
import com.mjh.model.R;
import com.mjh.service.UserRoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 权限修改
 */
@RestController
@RequestMapping("/api/userRole")
public class UserRoleController {

    @Autowired
    private UserRoleService userRoleService;

    /**
     * 修改
     * @return
     */
   @PostMapping("/modify")
    public R<String> modifyUserRole(@RequestBody UserRole role){
       boolean rulet = userRoleService.modifyUserRole(role);
        return R.HANDLER(rulet);
    }
    @PostMapping("/add")
    public R<String> addUserRole(@RequestBody UserRole role){
        boolean rulet = userRoleService.addUserRole(role);
        return R.HANDLER(rulet);
    }

}
